<template>
  <div class="banner">
    <div v-preview="store.getGetPreviewImg()" v-origin="bg">
    </div>
    <p>
      <slot></slot>
    </p>
  </div>
</template>

<script setup lang="ts">
import { withDefaults, inject } from 'vue'
const store: any = inject('store')
withDefaults(defineProps<{
  bg: string
}>(), {
  bg: 'https://w.wallhaven.cc/full/we/wallhaven-weeqzx.jpg'
})
</script>

<style scoped lang="scss">
.banner {
  display: flex;
  position: relative;
  height: 400px;
  width: 100%;
  z-index: -1;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: rgb(51, 48, 48);

  p {
    display: flex;
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    letter-spacing: 15px;
    font-size: 25px;
    color: #fff;
  }
}

@media (max-width: 760px) {
  .banner {
    height: 200px;

    p {
      font-size: 16px;
    }
  }
}
</style>